From: Christian Weber Date: Tue, 8 May 2012 20:03:17 +0000 (+0200) Subject: searchDisplay: Use the rowLimit we pass to the IconGrid X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6516 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c1f51a7bf34a97fe344ca9d6f48b5ca8be18d15a;p=gnome-shell.git searchDisplay: Use the rowLimit we pass to the IconGrid When displaying children, we need to make sure that we use the rowLimit property that we pass to iconGrid, rather than assuming that it's always MAX_SEARCH_RESULTS_ROWS in case some subclass (in an extension maybe) wants to do something different. https://bugzilla.gnome.org/show_bug.cgi?id=675527 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index ef71bc7a0..792932868 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -282,6 +282,10 @@ const IconGrid = new Lang.Class({ return this._computeLayout(rowWidth)[0]; }, + getRowLimit: function() { + return this._rowLimit; + }, + _computeLayout: function (forWidth) { let nColumns = 0; let usedWidth = 0; diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js index fb1ca73e0..9ca5198f9 100644 --- a/js/ui/searchDisplay.js +++ b/js/ui/searchDisplay.js @@ -131,7 +131,7 @@ const GridSearchResults = new Lang.Class({ getResultsForDisplay: function() { let alreadyVisible = this._pendingClear ? 0 : this._grid.visibleItemsCount(); - let canDisplay = this._grid.childrenInRow(this._width) * MAX_SEARCH_RESULTS_ROWS + let canDisplay = this._grid.childrenInRow(this._width) * this._grid.getRowLimit() - alreadyVisible; let numResults = Math.min(this._notDisplayedResult.length, canDisplay);